package response

import (
	"github.com/gin-gonic/gin"
	"net/http"
)

func Response(c *gin.Context, code int, msg string, data interface{})  {
	c.JSON(code, gin.H{"msg": msg, "data": data})
}

func ResponseSuccess(c *gin.Context, msg string)  {
	c.JSON(http.StatusOK, gin.H{"msg": msg})
}

func ResponseSuccessWithData(c *gin.Context, msg string, data interface{})  {
	c.JSON(http.StatusOK, gin.H{"msg": msg, "data": data})
}

func ResponseError(c *gin.Context, code int, msg string)  {
	c.JSON(code, gin.H{"msg": msg})
}